<include file="Common/header" />
<title>房间管理</title>
</head>
<body>
<nav class="breadcrumb">
	<i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 巡检管理
	<span class="c-gray en">&gt;</span> 巡检日志
	<a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" >
		<i class="Hui-iconfont">&#xe68f;</i>
	</a>
</nav>
<div class="pd-20">
	<div class="panel panel-primary">
		<div class="panel-header">按条件查询</div> 
		<div class="panel-body">
			巡检人：<input class="input-text radius" id="nickname" name="nickname" style="width: 120px; " />
			巡检点：
			<span class="select-box radius" style="width: 120px;">
				<select id="blue" name="blue" class="select radius">
					<option value="0">全部</option>
					<?php foreach($bluelist as $blue){ ?>
					<option value="{$blue['blue_id']}">{$blue['blue_nick']}</option>
					<?php } ?>
				</select>
			</span>
			巡检时间：
			<span class="select-box radius" style="width: 120px;">
				<input type="text" name="times" id="times" class="select layer-date radius time" value="" />
			</span>
			<a href="javascript:;" class="btn btn-success radius querys"><i class="Hui-iconfont">&#xe709;</i> 查询</a> 
		</div>
	</div>
</div>

<div class="pd-20">
	<div class="cl pd-5 bg-1 bk-gray"> 
		<span class="r">共有数据：<strong>{$count}</strong> 条</span>
	</div>
	<div class="dataTables_wrapper no-footer" id="ajaxDiv">
		<include file="Bluetooth/logs_list" />
	</div>
</div>
<script type="text/javascript" src="__PUBLIC__/h-ui/lib/socket.io/socket.io.js"></script>
<script>
	/**
	 * 报警弹出层
	 **/
	function alartDiv(desc){
		//预先关闭所有的PAGE弹出框
		layer.closeAll('page');
		layer.open({
			type: 1
			,area: ['400px', '200px']
			,title: '巡检提醒'
			,shade: 0
			,maxmin: true
			,anim: 2
			,content: '<div style="padding:10px;">'+ desc +'</div>'
			,offset: 'rb'
			,time: 3000
		});
	}
	
	var socket = io.connect("http://mamagy.com:8016?uid="+ "{$Think.session.user_id}");
	socket.on('PushLocationChange', function(data){
		//监听数据
		alartDiv(data.nickname + ' '+ data.blue_nick);
	});
</script>
<script type="text/javascript">
	/*管理员-角色-添加*/
	function admin_role_add(title,url,w,h){
		layer_show(title,url,w,h);
	}
	/*管理员-角色-编辑*/
	function admin_role_edit(title,url,id,w,h){
		layer_show(title,url,w,h);
	}
	
	$(document).ready(function(){
		$(".time").on('click', function(){
			laydate({istime: true, format: 'YYYY-MM-DD'});
		});
		
		$(".btn-success").on('click', function(){
			var load = layer.load(2);
			var where = {};
				where.nickname = $("#nickname").val();
				where.blue_id = $("#blue").val();
				where.times = $("#times").val();
				where.ajax = 1;
			$.get('logs.html', where, function(data){
				layer.close(load);
				$("#ajaxDiv").html(data);
			});
		});
	});
</script>
</body>
</html>